package com.dazhuang;

import com.dazhuang.aop.User;
import com.dazhuang.trans.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyApplication {
	public static void main(String[] args) {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml");
		User user = (User)applicationContext.getBean("user");
		// cglib动态代理时调用方法会进入到CglibAopProxy类中的intercept方法
		user.show();

		UserDao userDao = (UserDao)applicationContext.getBean("userDao");
		userDao.transfer("Tom","Jack",1000.0);
	}
}
